//
//  ZSBaseViewController.m
//  zhushou
//
//  Created by byAlex on 15/9/18.
//  Copyright © 2015年 jw. All rights reserved.
//

#import "ZSBaseViewController.h"
#import "ZSSearchViewController.h"

@interface ZSBaseViewController ()

@end

@implementation ZSBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setnavigationItems];
}

- (void)setnavigationItems
{
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"leftbar_icon"] style:UIBarButtonItemStylePlain target:self action:@selector(backRootPage)];
    leftItem.tintColor = [UIColor df_OrangeColor];
    self.navigationItem.leftBarButtonItem = leftItem;
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"right_bar"] style:UIBarButtonItemStylePlain target:self action:@selector(toSearchPage)];
    rightItem.tintColor = [UIColor df_OrangeColor];
    self.navigationItem.rightBarButtonItem = rightItem;
}

- (void)backRootPage
{
    [self.tabBarController.navigationController popViewControllerAnimated:YES];
}

- (void)toSearchPage
{
    ZSSearchViewController *searchVc = [[ZSSearchViewController alloc] init];
    [self.navigationController pushViewController:searchVc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
